//
//  MTWalletRecodedsCell.m
//  MeToo
//
//  Created by 俊松何 on 2018/7/22.
//  Copyright © 2018年 tianxie. All rights reserved.
//

#import "MTWalletRecodedsCell.h"
#import "NSDate+Category.h"
@interface MTWalletRecodedsCell ()

@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;
@property (weak, nonatomic) IBOutlet UILabel *typeLable;
@property (weak, nonatomic) IBOutlet UILabel *timeLable;
@property (weak, nonatomic) IBOutlet UILabel *valueLable;


@end

@implementation MTWalletRecodedsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

-(void)setModel:(MTCoinRecordsModel *)model
{
    _model = model;
    self.typeLable.text = model.title;
    NSDate *messageDate = [NSDate dateWithTimeIntervalInMilliSecondSince1970:(NSTimeInterval)model.recordDate];
    self.timeLable.text = [messageDate formattedTime];
    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:_model.iconImage]];
    if(model.receive)
    {
        self.valueLable.textColor  = UIColorFromRGB(0xf05522);
        self.valueLable.text = [NSString stringWithFormat:@"+%.2lf",model.value];
    }else{
        self.valueLable.textColor  = UIColorFromRGB(0x2b2c2c);
        self.valueLable.text = [NSString stringWithFormat:@"-%.2lf",model.value];
    }
}

@end
